/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.facilscrum.form.sprint;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.DefaultTableModel;
import org.facilscrum.beans.Proyectos;
import org.facilscrum.beans.Scrumdiario;
import org.facilscrum.beans.Sprint;
import org.facilscrum.beans.Sprintmeeting;
import org.facilscrum.beans.Sprintmeetingasistentes;
import org.facilscrum.beans.Userstoriessprint;
import org.facilscrum.beans.Usuarios;
import org.facilscrum.controller.SprintController;
import org.facilscrum.controller.SprintmeetingController;
import org.facilscrum.controller.SprintmeetingasistentesController;
import org.facilscrum.controller.UserstoriessprintController;
import org.facilscrum.controller.UsuariosController;
import org.facilscrum.generales.Mensajeria;
import org.facilscrum.sesion.MySesion;
import org.javscaz.javscaztools.utilidades.Utilidades;

/**
 *
 * @author avbravo
 */
public class SprintMeetingsForm extends javax.swing.JInternalFrame {

    Proyectos proyectos = new Proyectos();
    SprintController sprintController = new SprintController();
    Sprint sprint = new Sprint();
    Sprintmeeting sprintmeeting = new Sprintmeeting();
    SprintmeetingController sprintmeetingController = new SprintmeetingController();
    Sprintmeetingasistentes sprintmeetingasistentes = new Sprintmeetingasistentes();
    SprintmeetingasistentesController sprintmeetingasistentesController = new SprintmeetingasistentesController();
    Userstoriessprint userstoriessprint = new Userstoriessprint();
    UserstoriessprintController userstoriessprintController = new UserstoriessprintController();
    UsuariosController usuariosController = new UsuariosController();
    Usuarios usuarios = new Usuarios();
    List<Usuarios> listUsuarios = new ArrayList<>();
    DefaultTableModel modelo;
    List<Sprint> listSprint = new ArrayList<>();

    /**
     * Creates new form DailyScrumForm
     */
    public SprintMeetingsForm() {
        initComponents();
        modelo = (DefaultTableModel) jTable1.getModel();
        if (!MySesion.getSeleccionoProyectoTrabajo()) {
            Mensajeria.MensajeWarning("Debe indicar el proyecto de trabajo");
        } else {
            proyectos = MySesion.getProyectos();
            jTextFieldProyecto.setText(proyectos.getProyecto());
            jButtonGuardar.setEnabled(true);
            cargarComboSprint();
            java.util.Calendar ca = java.util.Calendar.getInstance();
            java.sql.Date mydate = new java.sql.Date(ca.getTimeInMillis());
            jXDatePickerFecha.setDate(mydate);
            jXDatePickerFecha.setFormats(new SimpleDateFormat("dd/MM/yyyy"));
        }
       
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jComboBoxSprint = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextAreaComentario = new javax.swing.JTextArea();
        jTextFieldProyecto = new javax.swing.JTextField();
        jXDatePickerFecha = new org.jdesktop.swingx.JXDatePicker();
        jButtonGuardar = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jButtonRegresar = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        jFormattedTextFieldFechaInicio = new javax.swing.JFormattedTextField();
        jLabel9 = new javax.swing.JLabel();
        jFormattedTextFieldFechaTerminacion = new javax.swing.JFormattedTextField();

        setClosable(true);
        setTitle("Sprint Meetings");

        jLabel1.setText("Proyecto");

        jLabel2.setText("Fecha");

        jLabel3.setText("Asistentes");

        jLabel4.setText("Sprint");

        jComboBoxSprint.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                jComboBoxSprintItemStateChanged(evt);
            }
        });
        jComboBoxSprint.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxSprintActionPerformed(evt);
            }
        });

        jLabel5.setText("Comentarios");

        jTextAreaComentario.setColumns(20);
        jTextAreaComentario.setRows(5);
        jScrollPane2.setViewportView(jTextAreaComentario);

        jTextFieldProyecto.setEnabled(false);

        jXDatePickerFecha.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jXDatePickerFechaActionPerformed(evt);
            }
        });

        jButtonGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/facilscrum/gif/Save.png"))); // NOI18N
        jButtonGuardar.setToolTipText("Guardar");
        jButtonGuardar.setEnabled(false);
        jButtonGuardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonGuardarActionPerformed(evt);
            }
        });

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Asistio", "Username", "Usuario"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Boolean.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                true, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(jTable1);
        jTable1.getColumnModel().getColumn(0).setPreferredWidth(60);

        jButtonRegresar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/facilscrum/gif/return.png"))); // NOI18N
        jButtonRegresar.setToolTipText("Regresar");
        jButtonRegresar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRegresarActionPerformed(evt);
            }
        });

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/facilscrum/gif/search.png"))); // NOI18N
        jButton1.setToolTipText("Procesar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel8.setText("Inicio");

        jFormattedTextFieldFechaInicio.setEnabled(false);

        jLabel9.setText("Terminacion");

        jFormattedTextFieldFechaTerminacion.setEnabled(false);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(jLabel1)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel3))
                        .addGap(13, 13, 13)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldProyecto, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jComboBoxSprint, javax.swing.GroupLayout.PREFERRED_SIZE, 292, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(27, 27, 27)
                                .addComponent(jButton1))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(13, 13, 13)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jButtonGuardar, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jButtonRegresar, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jXDatePickerFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addComponent(jLabel2)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(68, 68, 68)
                        .addComponent(jFormattedTextFieldFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel9)
                        .addGap(4, 4, 4)
                        .addComponent(jFormattedTextFieldFechaTerminacion, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(62, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jTextFieldProyecto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jComboBoxSprint, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jLabel9)
                    .addComponent(jFormattedTextFieldFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jFormattedTextFieldFechaTerminacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(jXDatePickerFecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButtonGuardar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonRegresar))
                .addGap(26, 26, 26))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jComboBoxSprintActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxSprintActionPerformed
        search();
    }//GEN-LAST:event_jComboBoxSprintActionPerformed

    private void jButtonRegresarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRegresarActionPerformed
        dispose();
    }//GEN-LAST:event_jButtonRegresarActionPerformed

    private void jButtonGuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonGuardarActionPerformed
        guardar();
    }//GEN-LAST:event_jButtonGuardarActionPerformed

    private void jXDatePickerFechaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jXDatePickerFechaActionPerformed
        // jButtonGuardar.setEnabled(noExiste());
    }//GEN-LAST:event_jXDatePickerFechaActionPerformed

    private void jComboBoxSprintItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jComboBoxSprintItemStateChanged
        // TODO add your handling code here:
    }//GEN-LAST:event_jComboBoxSprintItemStateChanged

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        search();
    }//GEN-LAST:event_jButton1ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButtonGuardar;
    private javax.swing.JButton jButtonRegresar;
    private javax.swing.JComboBox jComboBoxSprint;
    private javax.swing.JFormattedTextField jFormattedTextFieldFechaInicio;
    private javax.swing.JFormattedTextField jFormattedTextFieldFechaTerminacion;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextArea jTextAreaComentario;
    private javax.swing.JTextField jTextFieldProyecto;
    private org.jdesktop.swingx.JXDatePicker jXDatePickerFecha;
    // End of variables declaration//GEN-END:variables

    private void search() {
        try {
             if(listSprint.size()== 0){
                return;
            }
            jButtonGuardar.setEnabled(false);
            modelo = Utilidades.limpiarModelo(modelo);
            limpiar();
            Boolean habilitar = false;
            int j = jComboBoxSprint.getSelectedIndex();
            if (j != -1) {
                sprint =    sprint = listSprint.get(j); 
                jFormattedTextFieldFechaInicio.setText(Utilidades.formatearFecha(sprint.getFechainicio()));
                jFormattedTextFieldFechaTerminacion.setText(Utilidades.formatearFecha(sprint.getFechaterminacion()));
                habilitar = cargarUsuarios();
            } 
            //  jButtonGuardar.setEnabled(habilitar);
            if (habilitar) {
                if (noExiste(sprint)) {
                    jButtonGuardar.setEnabled(true);
                } else {
                   
                        Mensajeria.MensajeWarning("Este sprintmeeting ya se registro anteriormente \npara este sprint");
                        jButtonGuardar.setEnabled(false);
                
                }
            }
      
        } catch (Exception ex) {
            Mensajeria.MensajeError(ex, "search()");
        }
    }

    private Boolean cargarComboSprint() {
        try {
            jComboBoxSprint.removeAllItems();
             listSprint.removeAll(listSprint);
            String where = "idproyecto='" + proyectos.getIdproyecto() + "' and abierto='si' ";
            if (sprintController.query(where)) {
                for (Sprint s : sprintController.getSprintlist()) {
                    if(noExiste(s)){
                        jComboBoxSprint.addItem(s.getIdsprint() + " - " + s.getNombre());
                           Sprint s1 = new Sprint();
                        s1 = s;
                        listSprint.add(s);
                    }
                    
                }
                return true;
            }
        } catch (Exception ex) {
            Mensajeria.MensajeError(ex, "cargarComboSprint() ");
        }
        return false;
    }

    private void limpiar() {
        jTextAreaComentario.setText("");
    }

    private Boolean cargarUsuarios() {
        try {
            Boolean haveRecord = false;
            modelo = Utilidades.limpiarModelo(modelo);
            listUsuarios.removeAll(listUsuarios);
            String sql = "idsprint='" + sprint.getIdsprint() + "'";
            Boolean encontrado = false;

            if (userstoriessprintController.query(sql)) {
                for (Userstoriessprint u : userstoriessprintController.getUserstoriessprintlist()) {

                    encontrado = false;

                    for (Usuarios us : listUsuarios) {
                        haveRecord = true;
                        if (us.getCedula().equals(u.getUserstories().getUsuarios().getCedula())) {
                            encontrado = true;
                        }

                    }
                    if (!encontrado) {
                        Usuarios usuarios1 = new Usuarios();
                        usuarios1 = u.getUserstories().getUsuarios();
                        Object[] filas = new Object[3]; // Hay tres columnas en la tabla       
                        filas[0] = false;
                        filas[1] = u.getUserstories().getUsuarios().getUsername();
                        filas[2] = u.getUserstories().getUsuarios().getNombre();
                        modelo.addRow(filas);
                        listUsuarios.add(usuarios1);
                    }

                }
                return haveRecord;
            } else {
                Mensajeria.Mensaje("Debe crear primero los usuarios ");
            }
        } catch (Exception ex) {
            Mensajeria.MensajeError(ex, "cargarComboUsuarios() ");

        }
        return false;
    }

    private Boolean noExiste(Sprint s) {
        try {
            String sql = "idsprint='" + s.getIdsprint() + "'";
            if (!sprintmeetingController.query(sql)) {
                return true;
            }
        } catch (Exception ex) {
            Mensajeria.MensajeError(ex, "noExiste()");
        }
        return false;
    }

    private void guardar() {
        try {
            if (!noExiste(sprint)) {
                return;
            }
            Boolean isSeleccionado = false;
            String temp;
            for (int i = 0; i < modelo.getRowCount(); i++) {
                temp = modelo.getValueAt(i, 0).toString();
                if (temp.equals("true")) {
                    isSeleccionado = true;
                }
                //totalPuntosAsignados += Integer.parseInt(modelo.getValueAt(i, 4).toString());
            }
            if (!isSeleccionado) {
                Mensajeria.MensajeWarning("Debe seleccionar los asistentes");
                return;
            }

            java.util.Date Fecha = jXDatePickerFecha.getDate();
            java.sql.Date fecha = new java.sql.Date(Fecha.getTime());
            if (fecha == null) {
                Mensajeria.MensajeWarning("Seleccione la fecha");
                jXDatePickerFecha.requestFocus();
                return;
            }
            if (jTextAreaComentario.getText() == null || jTextAreaComentario.getText().equals("")) {
                Mensajeria.MensajeWarning("Ingrese el comentario...");
                jTextAreaComentario.requestFocus();
                return;
            }

            sprintmeeting.setComentarios(jTextAreaComentario.getText());
            sprintmeeting.setFecha(fecha);
            sprintmeeting.setIdsprint(sprint.getIdsprint());
            if (!sprintmeetingController.insert(sprintmeeting)) {
                Mensajeria.MensajeWarning("No se puede insertar el registro " + sprintmeetingController.getMensaje());
                return;
            }

            Sprintmeeting sprintmeeting1 = new Sprintmeeting();
            String sql = "idsprint='" + sprintmeeting.getIdsprint() + "'";
            if (sprintmeetingController.query(sql)) {
                sprintmeeting1 = sprintmeetingController.getSprintmeetinglist().get(0);
            } else {
                Mensajeria.MensajeWarning("No hay registros de sprintmeeting con esa condición");
                return;
            }
            /*
             * 
             */
            for (int i = 0; i < modelo.getRowCount(); i++) {
                temp = modelo.getValueAt(i, 0).toString();
                if (temp.equals("true")) {
                    isSeleccionado = true;
                    temp = modelo.getValueAt(i, 1).toString();
                    sprintmeetingasistentes.setUsername(temp);
                    sprintmeetingasistentes.setIdsprintmeeting(sprintmeeting1.getIdsprintmeeting());
                    if (!sprintmeetingasistentesController.insert(sprintmeetingasistentes)) {
                        Mensajeria.MensajeWarning("No se pudo guardar el sprintmeetingasistentes \nMensaje:" + sprintmeetingasistentesController.getMensaje());
                        return;
                    }
                }
                //totalPuntosAsignados += Integer.parseInt(modelo.getValueAt(i, 4).toString());
            }
            Mensajeria.Mensaje("Proceso terminado");
            limpiar();
            cargarComboSprint();

        } catch (Exception ex) {
            Mensajeria.MensajeError(ex, "guardar");
        }
    }
}
